#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>

#include "Shaft.h"

Shaft* shaftConstruct(int lowestFloor, int highestFloor, int shaftId)
{
	Shaft *shaft;
	shaft = (Shaft*) malloc(sizeof(Shaft));
	shaft->lowestFloor = lowestFloor;
	shaft->highestFloor = highestFloor;
	shaft->elevator = elevatorConstruct(shaftId);
	shaft->shaftId = shaftId;
	return shaft;
}

void shaftDeconstruct(Shaft *shaft)
{
	elevatorDeconstruct(shaft->elevator);
	free(shaft);
}

void shaftAddDestination(Shaft *shaft, Destination *destination)
{
	// We might need to check if the destination is between lowest and highest
	// but I want to drop that logic at the manager, so it can choose another shaft if not 
	elevatorAddDestination(shaft->elevator, destination);
}

void shaftSendEvent(Shaft *shaft, elevatorEvent eventToExecute)
{
	elevatorSendEvent(shaft->elevator, eventToExecute);
}